package com.headwind.logistics.waybill.mapper;

import com.headwind.logistics.common.pojo.BaseNetSite;
import com.headwind.logistics.common.pojo.ExpressGrant;
import com.headwind.logistics.waybill.dto.ExpressRecordEmpDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author 小恶魔
 * @Date 2020-07-21 19:42
 * @Version 1.0
 * @DESCRIPTION 快递单发放数据访问层
 */
public interface ExpressSheetMapper {

    /**
     * 获取快递单取号信息
     * @param page
     * @param rows
     * @return
     */
    List<ExpressRecordEmpDTO> queryExpressRecord(@Param("page")Integer page,@Param("rows")Integer rows);

    /**
     * 获取最新的快递单号
     * @return
     */
    Long queryNewExpressEndNum();

    /**
     * 添加快递单号
     * @return
     */
    Integer addExpressNum(ExpressRecordEmpDTO expressRecordEmpDTO);

    /**
     * 批量删除快递单号取号表
     * @param expressIds
     * @return
     */
    Integer batchDeleteExpressFetchRecordById(List<String> expressIds);

    /**
     * 根据取号表id 查看取号表里的号段是否已分发
     * @param expressRecordId
     * @return
     */
    Integer queryExpressFetchAndGrant(Long expressRecordId);

    /**
     * 根据行政区域id 获取 具体网点营业信息
     * @param areaId
     * @return
     */
    List<BaseNetSite> queryNetAreaSiteByAreaId(Integer areaId);


    /**
     * 添加面单发放记录表
     * @param expressGrant
     * @return
     */
    Integer addExpressGrant(ExpressGrant expressGrant);

    /**
     * 更改面单取号表的状态
     * @param start
     * @param expressRecordId
     * @return
     */
    Integer updateExpressGrantStartById(@Param("start")Integer start,@Param("expressRecordId")Long expressRecordId);
}
